import request from '@/utils/request'

export function requestPostPage(data) {
  return request({
    url: '/api/sys/post/page',
    method: 'post',
    loading: true,
    data,
  })
}

export function requestPostCreate(data) {
  return request({
    url: '/api/sys/post/insertIgnoreNull',
    method: 'post',
    data: data,
  })
}
export function requestPostUpdate(data) {
  return request({
    url: `/api/sys/post/updateIgnoreNull`,
    method: 'post',
    data: data,
  })
}
export function requestPostDelete(params) {
  return request({
    url: `/api/sys/post/delete`,
    method: 'post',
    data: { id: params.id },
  })
}
export function requestPostBatchDelete(list) {
  return request({
    url: `/api/sys/post/batchDelete`,
    method: 'post',
    data: list.map((item) => Number(item.id)),
  })
}
